import { https } from '../utils/https'
import type {
  BannerItem,
  CategoryItem,
  HotItem,
  GuessItem,
} from '../types/home.d'
import type { PageParams, PageResult } from '@/types/global'
// 获取前台轮播图
export const getHomeBannerApi = (defalut = 1) => {
  return https<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: { defalut },
  })
}
// 获取前台分类
export const getHomeCategoryApi = () => {
  return https<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}
// 获取前台推荐
export const getHomeHotPanelApi = () => {
  return https<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}
// 获取前台猜你喜欢
export const getHomeGuessApi = (data?: PageParams) => {
  return https<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
